import 'package:mvvm_provider/base/base_state.dart';
import 'package:mvvm_provider/page/collection/data/repository/collection_repository.dart';
import 'package:mvvm_provider/page/collection/states/collection_state.dart';
import 'package:mvvm_provider/page/collection/view_model/handle_data_view_model.dart';
import 'package:mvvm_provider/page/home/data/model/cartoon_model.dart';
import 'package:mvvm_provider/page/home/data/repository/home_repository.dart';
import 'package:mvvm_provider/until/app_util.dart';
import 'package:provider/provider.dart';
import '../../../base/base_view_model.dart';
import '../../../config/handle_state.dart';
import '../../../model/response_model.dart';

class CollectionViewModel {
  final HandleDataViewModel handleDataViewModel;
  CollectionViewModel(this.handleDataViewModel);

  /// 查询收藏数据
  List<CartoonModel>? getCollectionListData() {
    return handleDataViewModel.dataList;
  }

  /// 查询全部数据
  Future<List<CartoonModel>?> getAllListData() async {
    ResponseModel responseModel = await HomeRepository.getListData<CarDataModel>(1);
    CarDataModel carDataModel = responseModel.data;
    return carDataModel.feeds;
  }
}
